import requests

session = requests.Session()
# 用一个Session对象分别发起两次get请求,相当于在一个浏览器发起请求
session.get('http://httpbin.org/cookies/set/number/123')
response = session.get('http://httpbin.org/cookies')
print(response.text)